//
//  ShareSDKVC.m
//  星星计划
//
//  Created by mo on 16/6/7.
//  Copyright © 2016年 moyejin. All rights reserved.
//

#import "ShareSDKVC.h"

#import <ShareSDK/ShareSDK.h>
#import <ShareSDKConnector/ShareSDKConnector.h>

//腾讯开放平台（对应QQ和QQ空间）SDK头文件
#import <TencentOpenAPI/TencentOAuth.h>
#import <TencentOpenAPI/QQApiInterface.h>
//微信SDK头文件
#import "WXApi.h"



//初始化 shareSDK

@interface ShareSDKVC ()

@end

@implementation ShareSDKVC


+ (void)shareSDK{
    
    [ShareSDK registerApp:@"15ed18b903627"
          activePlatforms:@[
                            @(SSDKPlatformTypeSinaWeibo),
                            @(SSDKPlatformTypeQQ),
                            @(SSDKPlatformTypeWechat),
                            @(SSDKPlatformTypeSMS)
                            
                            ]
                 onImport:^(SSDKPlatformType platformType) {
                     
                     switch (platformType)
                     {
                             
                         case SSDKPlatformTypeQQ:
                             [ShareSDKConnector connectQQ:[QQApiInterface class] tencentOAuthClass:[TencentOAuth class]];
                             break;
                         case SSDKPlatformTypeWechat:
                             [ShareSDKConnector connectWeChat:[WXApi class]];
                             break;
                             
                         default:
                             break;
                     }
                     
                 }
          onConfiguration:^(SSDKPlatformType platformType, NSMutableDictionary *appInfo) {
              
              switch (platformType)
              {
                      //QQ
                  case SSDKPlatformTypeQQ:
                      [appInfo SSDKSetupQQByAppId:@"1105531495" appKey:@"F69p3nzj61tzCbO0" authType:SSDKAuthTypeBoth];
                      
                      break;
                      //微信
                  case SSDKPlatformTypeWechat:
                      [appInfo SSDKSetupWeChatByAppId:@"wx55a4d290f5e74596" appSecret:@"5814bd360572c6f7161fc0b21bfbd2b9"];
                      
                      break;
                      
                      
                      // 新浪微博
                  case SSDKPlatformTypeSinaWeibo:
                      [appInfo SSDKSetupWeChatByAppId:@"" appSecret:@""];
                      
                      break;

                      
                  default:
                      break;
              }
              
          }];
    

    
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
